package com.kuang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @program: springboot-01-helloworld
 * @description:
 * @author: 陈恩涛
 * @create: 2020-10-13 21:05
 **/

@Controller
@RequestMapping("/hello")
public class HelloController {

    /*@Controller+@ResponseBody这两个注解的组合等价于@RestController*/
    @GetMapping("/hello01/{name}")
    @ResponseBody
    public String hello(@PathVariable("name") String name){
        return "hello, " + name;
    }


}
